package cn.edu.just.firstjavaapp.l5;

public class Main {

    public static void main(String[] args) {
        int s = sum(10,1,2,3);
        System.out.println(s);
        int s2 = sum(100,1,2,3,4,5,6,7);
        System.out.println(s2);
    }

    static  int sum(int x,int... a){
        int sum=x;
        for(int i=0;i<a.length;i++)
            sum+=a[i];
        return sum;
    }
}
